home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / dev / amos / AMOSL0495.lzh / AMOSLIST / 000127_amos-request@svcs1.digex.net_Wed Apr 26 19:17:42 1995.msg < prev    next >
Internet Message Format  |  1995-05-01  |  2KB

  1. Received: from svcs1.digex.net by nfs1.digex.net with SMTP id AA25134
  2.   (5.67b8/IDA-1.5); Wed, 26 Apr 1995 19:17:10 -0400
  3. Received: by svcs1.digex.net id AA25197
  4.   (5.67b8/IDA-1.5 for amos-out); Wed, 26 Apr 1995 14:41:49 -0400
  5. Received: from nfs1.digex.net by svcs1.digex.net with SMTP id AA25193
  6.   (5.67b8/IDA-1.5 for <amos@svcs1.digex.net>); Wed, 26 Apr 1995 14:41:43 -0400
  7. Received: from cheviot.ncl.ac.uk by nfs1.digex.net with SMTP id AA05945
  8.   (5.67b8/IDA-1.5 for <amos-list@access.digex.net>); Wed, 26 Apr 1995 14:41:24 -0400
  9. Received: from TOWN4.ncl.ac.uk by cheviot.ncl.ac.uk id <TAA23972@cheviot.ncl.ac.uk>
  10.   (8.6.10/ for ncl.ac.uk) with SMTP; Wed, 26 Apr 1995 19:41:16 +0100
  11. Received: from TOWN4/MAILQUEUE by TOWN4.ncl.ac.uk (Mercury 1.13);
  12.     Wed, 26 Apr 95 19:41:15 GMT0BST
  13. Received: from MAILQUEUE by TOWN4 (Mercury 1.13); Wed, 26 Apr 95 19:41:09 GMT0BST
  14. From: "C.J.COULSON" <C.J.Coulson@newcastle.ac.uk>
  15. To: amos-list@access.digex.net
  16. Date:          Wed, 26 Apr 1995 19:41:07 GMT0BST
  17. Subject:       Re: Help Needed 
  18. Priority: normal
  19. X-Mailer: Pegasus Mail/Windows (v1.22)
  20. Message-Id: <8A90A4F7E17@TOWN4.ncl.ac.uk>
  21. Status: O
  22. X-Status: 
  23.  
  24. > And now, a problem of my own:
  25. > In the Amos Pro manual it says that a command like
  26. > Randomize 8
  27. > will set the random number generator to produce the
  28. > same sets of numbers every time. Yet, it does not on my
  29. > A1200. Why? (although I think I know - it`s another
  30. > Amos `feature` no doubt)
  31. > D.P.O`Cuinn
  32. >
  33.  
  34. It`s not the Randomise command at fault, it`s
  35. the Rnd command.
  36.  
  37. You have to call the Rnd function with a negative
  38. number in order to get repeatable random sequences.
  39.  
  40. e.g.
  41.  
  42. For A=1 to 10
  43.    Randomise 42
  44.    For B=1 to 10
  45.       Print Rnd(100)
  46.    Next B
  47. Next A
  48.  
  49. will give 10 sets of totally random numbers, whereas
  50.  
  51. For A=1 to 10
  52.    Randomise 42
  53.    For B=1 to 10
  54.       Print Rnd(-100)
  55.    Next B
  56. Next A
  57.  
  58. will give 10 sets of identical random numbers.
  59. Note that using a -ve number still results in
  60. positive random numbers being generated.
  61.  
  62.  
  63. Regards
  64. Chris
  65.  
  66. ---------------------------------------------------------------------
  67. Chris Coulson            | A4000/EC030/882 - 18MB/530MB
  68. Robotics Postgraduate        | Pentium 60 - 16MB/540MB/CD-ROM
  69.                 | 
  70. E-Mail:                |    The Best of Both Worlds
  71. c.j.coulson@ncl.ac.uk        |
  72. ---------------------------------------------------------------------
  73.  
  74.